package com.link2room.aeriabots.facade;

import com.link2room.aeriabots.dto.param.base.WxComponentParamDto;
import com.link2room.aeriabots.dto.result.base.WXOfficialAccountInfoDto;
import com.link2room.common.dto.param.base.BaseParamDto;

/**
 * Created by LN on 2016/9/1.
 */
public interface IWXComponentFacadeService {
    /**
     * 接收wx Ticket，并缓存
     * @param verifyTicketDto
     * @throws Exception
     */
    void setVerifyTicket(WxComponentParamDto verifyTicketDto) throws Exception;

    /**
     * 更新微信开放平台 授权token
     * @throws Exception
     */
    void updateComponentAccessToken() throws Exception;

    /**
     * 刷新AuthorToken
     * 更新jspTicket 用于公众号支付
     * @return
     * @throws Exception
     */
    void refreshAuthorizerToken() throws Exception;

    /**
     * 获得公众号授权链接
     * @return
     * @throws Exception
     */
    String getOfficialAccountsAuthorizerURL(WxComponentParamDto paramDto) throws Exception;

    /**
     * 获得微信开放平台appid
     * @return
     */
    String getWxComponentAppid() throws Exception;

    /**
     * 生成并保存授权token
     * @param paramDto
     * @throws Exception
     */
    void saveAuthorizerAccessToken(WxComponentParamDto paramDto) throws Exception;
    /**
     * 获得微信网页授权URL
     */
    String getAccessCodeURL(WxComponentParamDto paramDto) throws Exception;
    /**
     * httppost 请求获得weixinUserinfo
     */
    String getOpenid(WxComponentParamDto paramDto) throws Exception;

    /**
     * 获得授权token
     * @param paramDto
     * @return
     * @throws Exception
     */
    String getAuthorizerAccessToken(WxComponentParamDto paramDto) throws Exception;

    /**
     * 微信公众好基本信息
     * @param paramDto
     * @return
     * @throws Exception
     */
    WXOfficialAccountInfoDto getWXOfficialAccountInfoDto(BaseParamDto paramDto) throws Exception;
}
